﻿@{
    ViewBag.Title = "Productos";
    Layout = "~/Views/Shared/_Layout.cshtml";
    LocalView local = (LocalView)ViewData["Local"];
}
@using Helena.Areas.Configuraciones.Models
@using Telerik.Web.Mvc.UI

@model IEnumerable<ConfiguracionView>  

<div class="block big" style="position: relative">
    <!-- Block Begin -->
    <div class="titlebar">
        <h3>
            Configuracion de la Tienda
        </h3>
    </div>
    <table style="width:100%; top:0px">
        <tr>
            <td>
                <table>
                    <tr>
                        <th>Nombre del Local: </th>
                        <td>@local.NombreLocal</td>                    
                    </tr>
                    <tr>
                        <th>Ruc: </th>
                        <td>@local.Ruc</td>                    
                    </tr>
                    <tr>
                        <th>Telefono: </th>
                        <td>@local.Telefono</td>                    
                    </tr>
                    <tr>
                        <th>Direccion: </th>
                        <td>@local.Direccion</td>                    
                    </tr>
                </table>                
            </td>
            <td>
            
             <div class="block_cont">
        @(Html.Telerik().Grid(Model)
        .Name("ConfiguracionGrid")
        .Localizable("es-ES")
        .Filterable()
        .ToolBar(commands => commands.Insert())
            .Editable(editing => editing
            .Mode(GridEditMode.InLine)
            //.TemplateName("CopiadeSubProductos")
            )
        .DataKeys(keys => keys.Add(o => o.ID))
            .Columns(columns =>
            {
                columns.ForeignKey(c => c.LocalID, (System.Collections.IEnumerable)ViewData["Locales"], "ID", "NombreLocal").Width(120);
                columns.Bound(c => c.Fecha).Width(200);
                columns.Bound(c => c.TipoCambio).Width(100).Format("{0:S/ ###,###.##}");
                columns.Bound(c => c.ValorIGV).Width(100).Format("{0:#.# %}");
                columns.Command(commands => 
                    {
                        commands.Edit().ButtonType(GridButtonType.Image);
                        commands.Delete().ButtonType(GridButtonType.Image);
                    }).Title("Acciones").Width(50);
            })
            .Pageable()
            .Sortable()
            .Scrollable(scrolling => scrolling.Height(250))
            .PrefixUrlParameters(false)
            .DataBinding(dataBinding => dataBinding
            .Ajax()
                .Select("Select", "Local")
                .Insert("Insert", "Local")
                .Delete("Delete", "Local")
                .Update("Update", "Local")
                        )
        )
            </div>

            </td>
        </tr>
    </table>
   @Html.Telerik().ScriptRegistrar().Globalization(true)
    <!-- Table Wrapper End -->
</div>